<?php
include './include/common.inc.php';
include '../include/attachment.class.php';

$attachment = new attachment;
$action = isset($action) ? $action : 'manage';

switch($action)
{
    case 'delete' :
        $have_parm = check_perms('att002');
        if($have_parm == false)
            {
                showmessage('您没有权限进行此操作！');
                $response->execute();
            }
        break;

    default :
        $have_parm = check_perms('att001');
        if($have_parm == false)
            {
                showmessage('您没有权限进行此操作！');
                $response->execute();
            }
        $page = isset($page) ? intval($page) : 1;
        $page = max($page, 1);
        $pagesize = 20;
        $data = $attachment->list_info($page, $pagesize);
        $page = $attachment->page($page, $pagesize);
        include template('admin', 'attachment');

}
?>